<p:dialog xmlns="http://www.w3.org/1999/xhtml"
      	  xmlns:h="http://java.sun.com/jsf/html"
      	  xmlns:f="http://java.sun.com/jsf/core"
      	  xmlns:ui="http://java.sun.com/jsf/facelets"
      	  xmlns:p="http://primefaces.org/ui"
      	  modal="true"  resizable="true" width="30%"
		  widgetVar="dialogConsultarMarca" id="idDialogConsultarMarca" closable="true"
		  appendTo="@(body)" header="Consultar Marcas"> 	
  	
	 <link rel="stylesheet" type="text/css" href="./estilos.css"/>  
<h:form id="formDialogConsultarMarca" prependId="false">
<h:panelGroup id="pgDialogConsultarMarca">
 	<p:messages id="messagesVendaConsultarMarca" autoUpdate="true" closable="true" />  
    	<h:panelGrid columns="4" style="margin-right:10%;">  
            <h:outputLabel value="Código" styleClass="outputLabel"/>  
            <h:outputLabel value="Marca" styleClass="outputLabel"/> 
            <h:outputLabel /> 
            <h:outputLabel /> 
            <p:inputText value="#{vendaBean.marca.idMarca}" styleClass="inputId">
            	<f:ajax listener="#{vendaBean.ajaxSaveMarca}"/>
            </p:inputText>  
  			<p:inputText value="#{vendaBean.marca.descricao}" styleClass="inputDescricao">
  				<f:ajax listener="#{vendaBean.ajaxSaveMarca}"/>
            </p:inputText>   
  			<p:commandButton value="Consultar" actionListener="#{vendaBean.findMarca}" process="@this" update="dataTableMarca" styleClass="commandButton" />
  			<p:commandButton value="Novo" ajax="true" actionListener="#{vendaBean.openDialogManterMarca}" process="@this" styleClass="commandButton" /> 
        </h:panelGrid> 
    		
    <p:dataTable id="dataTableMarca" var="Marca" value="#{vendaBean.dmMarca}"  
    			 rowKey="#{Marca.idMarca}" paginator="true" rows="10"  selectionMode="single" style="padding-top:20px;">    
		<p:column style="text-align:center; width:4%">  
            <f:facet name="header">  
                <h:outputText value="Código" />  
            </f:facet>  
            <h:outputText value="#{Marca.idMarca}" />  
        </p:column>  
  
        <p:column >  
            <f:facet name="header">  
                <h:outputText value="Marca" />  
            </f:facet>  
            <h:outputText value="#{Marca.descricao}" />  
        </p:column>    
        <p:column style="width:4%; text-align:center;">  
        	<f:facet name="header">
        	 <h:outputText value="Adicionar" />
        	</f:facet>
         	<p:commandButton id="selectButtonEditar" actionListener="#{vendaBean.selectMarca}" process="@this"  icon="ui-icon-circle-plus" title="Add" />
        </p:column> 
    </p:dataTable> 
 </h:panelGroup>
 </h:form>
 <ui:include src="/view/venda/dialogManterMarca.xhtml"></ui:include>
</p:dialog>
